﻿namespace C4F.DevKit.Bluetooth.ObjectPushProfile
{
    #region Using Directives
    using System;
    using System.ComponentModel;
    #endregion

    #region ObjectPushCompletedEventArgs

    /// <summary>
    /// EventArgs class to be used when an Object Push operation completes.
    /// </summary>
    public class ObjectPushCompletedEventArgs : AsyncCompletedEventArgs
    {
        #region Private Fields

        /// <summary>
        /// The name of the object that was pushed to the remote device.
        /// </summary>
        private string localObjectName;

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets the name of the object that was pushed to the remote device.
        /// </summary>
        public string LocalObjectName
        {
            get
            { return this.localObjectName; }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes the ObjectPushCompletedEventArgs object.
        /// </summary>
        /// <param name="localObjectName">The name of the object that was 
        /// pushed to the remote device.</param>
        /// <param name="error">An error that occurred during the asynchronous
        /// operation.</param>
        /// <param name="cancelled">A value indicating whether the asynchronous
        /// operation was cancelled.</param>
        /// <param name="userState">The user-supplied state object supplied 
        /// when the asynchronous operation was requested.</param>
        /// <exception cref="ArgumentNullException">localObjectName is passed
        /// as an empty string or a null reference.</exception>
        public ObjectPushCompletedEventArgs(string localObjectName,
                Exception error, bool cancelled, object userState)
            : base(error, cancelled, userState)
        {
            if (string.IsNullOrEmpty(localObjectName))
                throw new ArgumentNullException("localObjectName");

            this.localObjectName = localObjectName;
        }

        #endregion
    }

     #endregion
}